package main

import (
	"crypto/md5"
	"strings"
)

type Md5 struct{}

func (m *Md5) Check(content []byte, encrypted string) bool {
	encode := m.Encode(content)
	return strings.EqualFold(string(encode), encrypted)
}
func (m *Md5) Encode(data []byte) []byte {
	h := md5.New()
	h.Write(data)
	return h.Sum(nil)
}
